package shiyan2;

import java.util.Scanner;

public class shiyan {

	public static void main(String[] args) {
		Scanner in =new Scanner(System.in);
		  while (in.hasNextInt()) {
			  String s=in.nextLine();
			  Long a = Long.parseLong(s);
			  int i,b;
		      if(a>=10000&&a<=20000){
	    	  System.out.println(Long.toBinaryString(a)+","+Long.toOctalString(a)+","+Long.toHexString(a));}
		      
		      else{s=String.valueOf(Math.abs(a));
		      int sum=0;
		       char[] c=s.toCharArray();
		       for(i=0;i<c.length;i++){
		            System.out.print(c[i]+" ");
		            b=Integer.valueOf(c[i]+"");
		           sum+=b;
		       }
		        System.out.println(sum);
		      }

		      
		  }
	}

}
